from dataclasses import dataclass, field
import random
import string


def generate_id() -> str:
    return ''.join(random.choices(string.ascii_uppercase, k=12))


@dataclass(frozen=True)
class Person:
    name: str
    address: str
    active: bool = True
    email_addresses: list[str] = field(default_factory=list)
    id: str = field(default_factory=generate_id, init=False)
    _search_string: str = field(init=False, repr=False)
    
    def __post__init__(self) -> None:
        self._search_string = f'{self.name} {self.address}'



def main() -> None:
    person = Person('John Doe', '123 Main St')
    print(person)
    print(person.name)
    print(person.address)
    print(generate_id())


if __name__ == '__main__':
    main()
